class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int cur = 0;
        int dest = -1;
        int lenth = nums.size();
        for (cur = 0; cur < lenth; cur++) {
            if (nums[cur] != 0) {
                dest++;
                swap(nums[cur], nums[dest]);
            }

        }
    }
};